<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入 vue.js 文件 -->
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- checkbox 单选框 -->
        <label for="agree">
            <input type="checkbox" id="agree" v-model="isAgree">同意协议
        </label>

        <h2>你选择的是：{{isAgree}}</h2>
        <!-- :disabled 动态绑定样式 为true 禁用  默认是false 所有取反 -->
        <button :disabled="!isAgree">下一步</button>
        <br>

        <!-- checkbox 多选框 -->
        <label for="">
            <input type="checkbox" value="唱" v-model="hobbies">唱
            <input type="checkbox" value="跳" v-model="hobbies">跳
            <input type="checkbox" value="rap" v-model="hobbies">rap
            <input type="checkbox" value="篮球" v-model="hobbies">篮球
        </label>
        <h2>您爱好的是：{{hobbies}}</h2>

        <label :for="item" v-for="item in originHobblies">
            <input type="checkbox" :id="item" :value="item" v-model="hobbies">{{item}}
        </label>
    </div>
    <script>
        new Vue({
            el: "#app",
            data: {
                message: "Hello Vue",
                isAgree: false, // 单选框
                hobbies: [], // 多选框
                originHobblies: ['篮球', '乒乓球', '足球', '台球', '高尔夫球']
            },
        });
    </script>
</body>

</html>